package com.hznc.wcs.vo.bpm;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Description :
 * @Date : 2024/6/25
 * @Author : ChenJin
 * @Version : v1.0.0
 **/
@Data
public class BpmProcessInstanceRespVO {

    /**
     * 流程实例ID
     */
    private String id;

    /**
     * 流程名称
     */
    private String name;

    /**
     * 流程分类
     */
    private String category;
    
    private String categoryName;

    private Integer status; // 参见 BpmProcessInstanceStatusEnum 枚举

    private String statusLabel;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date startTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    private Long durationInMillis;

    private Map<String, Object> formVariables;

    private String businessKey;

    /**
     * 发起流程的用户
     */
    private User startUser;

    private String processDefinitionId;

    private String modelKey;
    /**
     * 流程定义
     */
    private BpmProcessDefinitionRespVO processDefinition;

    /**
     * 当前审批中的任务
     */
    private List<Task> tasks; // 仅在流程实例分页才返回

    @Data
    public static class User {

        private String id;
        
        private String realname;

    }

    @Data
    public static class Task {

        private String id;
        private String name;
        private String assignee;

    }
    
}
